<?php
/*
 * 用户账目明细
 */
namespace app\admin\controller;
use think\facade\Db;
use app\common\controller\AdminBase;
use app\common\model\Account as AccountModel;

class Account extends AdminBase
{

    protected function _initialize()
    {
        parent::_initialize();
    }

    public function lists()
    {
    	$param = $this->request->param();
        if (!empty($param['title'])) {
            $where = function ($query) use ($param){$query->where('name|mobile','LIKE', '%'.trim($param['title']).'%');};
        }else{
           $where = 1;
        }
        return $this->fetch('index',['list'=>AccountModel::hasWhere('user',$where)->with('user')->order('create_time','DESC')->paginate()]);
    }



}